package com.example.lowbird.lowbird.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;

import com.example.lowbird.lowbird.R;
import com.example.lowbird.lowbird.view.Shoptext;

public class Shopactivity extends AppCompatActivity {


    private Button bt;
    private Shoptext shopcar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_shopactivity);


        shopcar = ((Shoptext) findViewById(R.id.shopcar));

        bt = ((Button) findViewById(R.id.bt));

        bt.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                Log.e("SHOP", "onClick: "+shopcar.getMaxsize()+"，"+shopcar.getMinsize()+","+shopcar.getTextcount() );

                boolean b = shopcar instanceof Shoptext;

                Log.e("SHOP", "onClick: "+b );
                Log.e("SHOP", "onClick: "+shopcar.getMaxsize() );
                shopcar.setMaxsize(15);
                shopcar.setTextcount(2);

                shopcar.setMinsize(1);
                Log.e("SHOP", "onClick:2 "+shopcar.getMaxsize()+"，"+shopcar.getMinsize()+","+shopcar.getTextcount() );
            }
        });
    }
}
